package GamePoker.PokerJava;

import java.util.Scanner;

public class Particpatethree extends GameInit{
    PokerManager manager=new PokerManager();
    public int DownPayment;
    Scanner sc=new Scanner(System.in);
    GameProgress progress=new GameProgress();
    PokerPlayerMoney Money=new PokerPlayerMoney();
    public void GameStart() {
        System.out.println("三人拼点数游戏开始:");
    }
    @Override
    public void GamePlace() {
        String player1Name;
        String player2Name;
        String player3Name;
        System.out.println("请每一位玩家报上名来");
        System.out.println("玩家一:");
        player1Name=sc.next();
        System.out.println("玩家二:");
        player2Name=sc.next();
        System.out.println("玩家三:");
        player3Name=sc.next();
        System.out.println("发牌员开始随机发三张牌给三个选手");
        System.out.println(player1Name+"请展示财力:");
        PokerPlayerMoney c1=new PokerPlayerMoney();
        c1.PokerMoney=sc.nextInt();
        System.out.println(player2Name+"请展示财力:");
        PokerPlayerMoney c2=new PokerPlayerMoney();
        c2.PokerMoney=sc.nextInt();
        System.out.println(player3Name+"请展示财力:");
        PokerPlayerMoney c3=new PokerPlayerMoney();
        c3.PokerMoney=sc.nextInt();
        Poker player1=manager.getPoker();
        Poker player2=manager.getPoker();
        Poker player3=manager.getPoker();
        Player p1=new Player(player1,c1,player1Name);
        Player p2=new Player(player2,c2,player2Name);
        Player p3=new Player(player3,c3,player3Name);
        progress.DownPayment=DownPayment;
        progress.GamethreePepole(p1,p2,p3);
        progress.PokerCompareThree(p1,p2,p3);
        if(p1.WIN)
        {
            System.out.println("恭喜"+p1.playerName+"获得胜利获得奖池全部奖金"+(progress.total.total+p1.money.PokerMoney)+"元");
            p1.money.PokerMoney=progress.total.total;
        }
        if(p2.WIN)
        {
            System.out.println("恭喜"+p2.playerName+"获得胜利获得奖池全部奖金"+(progress.total.total+p2.money.PokerMoney)+"元");
            p2.money.PokerMoney=progress.total.total;
        }
        if(p3.WIN)
        {
            System.out.println("恭喜"+p3.playerName+"获得胜利获得奖池全部奖金"+(progress.total.total+p3.money.PokerMoney)+"元");
            p3.money.PokerMoney=progress.total.total;
        }
        System.out.println("游戏结束");
    }


}
